<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class model_giaovien extends CI_Model
{
    public function __construct() {
        parent::__construct();
    }

    public function layGiaoVien() {
    	$this->db->get('giaovien');
    	$this->db->from('giaovien');
        $this->db->order_by("magiaovien", "asc"); 
        $query = $this->db->get();
        return $query->result();
    }
    public function layChiTietGiaoVien($magiaovien) {
    	$this->db->get('giaovien');
    	$this->db->from('giaovien');
        $this->db->where('magiaovien', $magiaovien);
        $query = $this->db->get();
        return $query->result();
    }

    public function timgiaovien($daymon, $hoten) {
        $this->db->get('giaovien');
        $this->db->from('giaovien');
        $this->db->where('daymon', $daymon);
        $this->db->like('hoten', $hoten);
        $query = $this->db->get();
        return $query->result();
    }
    public function timgiaovien2($hoten) {
        $this->db->get('giaovien');
        $this->db->from('giaovien');
        $this->db->like('hoten', $hoten);
        $query = $this->db->get();
        return $query->result();
    }
}